package com.heima;

import com.alibaba.fastjson.JSON;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.enums.AppHttpCodeEnum;
import io.swagger.models.auth.In;

import java.util.*;

public class Demos {
    public static void main(String[] args) {
ArrayList<Integer> list = new ArrayList<>();
        int[] d = new int[5];
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入5个数");
        for (int i = 0; i < d.length; i++) {
            d[i] = sc.nextInt();
        }
      // 排序
        for (int i = 0; i < d.length-1; i++) {
            for (int j =0;j<d.length-i-1;j++){
                if (d[j]<d[j+1]){
                    //交换顺序
                    int tem = d[j];
                    d[j] = d[j+1];
                    d[j+1] = tem;
                }
            }
        }
        System.out.println("--------------");
        // 打印结果
        for (int i = 0; i < 5; i++) {
            System.out.println(d[i]);
        }
    }
    public static void findOnd(){
        List list = new ArrayList();

        Map map = new HashMap();
        map.put("anme","vhsn");
        map.put("age",33);
        list.add(map);
        list.add(map);
        ResponseResult result = ResponseResult.okResult(list);
        System.out.println(JSON.toJSONString(result));
    }
}
